package dto

import (
	"wit-admin-go/system/app/model"
)

// UserPage 分页和搜索
type UserPage struct {
	Page
	UserName string `from:"userName"` // 用户名
	Name     string `from:"name"`     // 用户名
}

// User 添加用户
type User struct {
	UserName string `json:"userName" validate:"required"`
	Password string `json:"password" validate:"required"`
	Name     string `json:"name" validate:"required"`
	Age      uint8  `json:"age"  validate:"gte=0,lte=130"`
	Sex      bool   `json:"sex"`
	Phone    string `json:"phone"`
	Email    string `json:"email" `
	Avatar   string `json:"avatar"`
	RoleId   string `json:"roleId"`
	Role     Role
	model.Model
}

// Login 登录
type Login struct {
	UserName string `json:"userName"`
	Password string `json:"password"`
}

// UpdateUser 修改信息
type UpdateUser struct {
	Name   string `json:"name"`
	Age    uint8  `json:"age"  validate:"gte=0,lte=130"`
	Sex    bool   `json:"sex"`
	Phone  string `json:"phone"`
	Email  string `json:"email" `
	Avatar string `json:"avatar"`
	RoleId string `json:"roleId"`
	Role   Role
	model.Model
}

// UpdateUserPassword 修改用户密码
type UpdateUserPassword struct {
	Password    string `json:"password" validate:"required"`
	TowPassword string `json:"towPassword" validate:"required"`
	model.Model
}

// UpdatePassword 修改用户密码
type UpdatePassword struct {
	Password    string `json:"password" validate:"required"`
	NewPassword string `json:"newPassword" validate:"required"`
	TowPassword string `json:"towPassword" validate:"required"`
	model.Model
}
